package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.CommentHistory;
import cn.wolfcode.trip.base.domain.Integral;
import cn.wolfcode.trip.base.query.CommentQueryObject;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface CommentHistoryMapper {
    int deleteByPrimaryKey(Long id);

    int insert(CommentHistory record);

    CommentHistory selectByPrimaryKey(Long id);

    List<CommentHistory> selectAll();

    int updateByPrimaryKey(CommentHistory record);

    List<CommentHistory> findCommentByParentId(@Param("parentId") Long parentId,
                                               @Param("qo")CommentQueryObject qo);

    /**
     * 查询我的二级回复
     * @param qo
     * @return
     */
    List<CommentHistory> selectCommentAndComment(QueryObject qo);

    /**
     * 获取用户的未读评论数
     * @param usereId
     * @return
     */
    Integer getUnreadComment(QueryObject qo);

    /**
     * 获取攻略文章的未读评论数
     * @param qo
     * @return
     */
    Integer getDetailUnread(QueryObject qo);


    /**
     * 修改攻略文章未读为已读
     * @param userId
     */
    void changeDetailStates(Long userId);

    /**
     * 查询子评论
     * @param userId
     * @return
     */
    List<Integral>  selectChilderenComment(Long userId);

    /**
     * 修改未读评论为已读
     * @param userId
     */
    void changeCommentStates(List<Integral> children);

    /**
     * 获取我的评论回复
     * @param qo
     * @return
     */
    List<CommentHistory> selectMyComment(QueryObject qo);

    /**
     * 查询回复我的攻略评论
     * @param qo
     * @return
     */
    List<Map> selectStrategyMessage(QueryObject qo);

    /**
     * 查询回复我的二级评论消息
     * @param qo
     * @return
     */
    List<Map> selectChildrenMessage(CommentQueryObject qo);

    /**
     * 查询我的朋友圈回复
     * @param qo
     * @return
     */
    List<Map> selectFriendCircleMessage(CommentQueryObject qo);
}